home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / src / binutils.252 / ld / ego32.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-17  |  4.6 KB  |  190 lines

  1. /* This file is is generated by a shell script.  DO NOT EDIT! */
  2.  
  3. /* emulate the original gld for the given go32
  4.    Copyright (C) 1991, 1993 Free Software Foundation, Inc.
  5.    Written by Steve Chamberlain steve@cygnus.com
  6.  
  7. This file is part of GLD, the Gnu Linker.
  8.  
  9. This program is free software; you can redistribute it and/or modify
  10. it under the terms of the GNU General Public License as published by
  11. the Free Software Foundation; either version 2 of the License, or
  12. (at your option) any later version.
  13.  
  14. This program is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. GNU General Public License for more details.
  18.  
  19. You should have received a copy of the GNU General Public License
  20. along with this program; if not, write to the Free Software
  21. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  22.  
  23. #define TARGET_IS_go32
  24.  
  25. #include "bfd.h"
  26. #include "sysdep.h"
  27. #include "bfdlink.h"
  28.  
  29. #include "ld.h"
  30. #include "config.h"
  31. #include "ldmain.h"
  32. #include "ldemul.h"
  33. #include "ldfile.h"
  34. #include "ldmisc.h"
  35.  
  36. static void gldgo32_before_parse PARAMS ((void));
  37. static char *gldgo32_get_script PARAMS ((int *isfile));
  38.  
  39. static void
  40. gldgo32_before_parse()
  41. {
  42. #ifndef TARGET_            /* I.e., if not generic.  */
  43.   ldfile_output_architecture = bfd_arch_i386;
  44. #endif /* not TARGET_ */
  45. }
  46.  
  47. static char *
  48. gldgo32_get_script(isfile)
  49.      int *isfile;
  50. {                 
  51.   *isfile = 0;
  52.  
  53.   if (link_info.relocateable == true && config.build_constructors == true)
  54.     return
  55. "OUTPUT_FORMAT(\"coff-go32\")\n\
  56. SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/go32/lib);\n\
  57. ENTRY(start)\n\
  58. SECTIONS\n\
  59. {\n\
  60.   .text  : {\n\
  61.     *(.text)\n\
  62.     ;\n\
  63.   }\n\
  64.   .data  : {\n\
  65.     *(.data)\n\
  66.     ;\n\
  67.   }\n\
  68.   .bss  :\n\
  69.   {                     \n\
  70.     *(.bss)\n\
  71.     *(COMMON)\n\
  72.     ;\n\
  73.   }\n\
  74. }\n\n"
  75.   ; else if (link_info.relocateable == true) return
  76. "OUTPUT_FORMAT(\"coff-go32\")\n\
  77. SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/go32/lib);\n\
  78. ENTRY(start)\n\
  79. SECTIONS\n\
  80. {\n\
  81.   .text  : {\n\
  82.     *(.text)\n\
  83.     ;\n\
  84.   }\n\
  85.   .data  : {\n\
  86.     *(.data)\n\
  87.     ;\n\
  88.   }\n\
  89.   .bss  :\n\
  90.   {                     \n\
  91.     *(.bss)\n\
  92.     *(COMMON)\n\
  93.     ;\n\
  94.   }\n\
  95. }\n\n"
  96.   ; else if (!config.text_read_only) return
  97. "OUTPUT_FORMAT(\"coff-go32\")\n\
  98. SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/go32/lib);\n\
  99. ENTRY(start)\n\
  100. SECTIONS\n\
  101. {\n\
  102.   .text  0x1000+SIZEOF_HEADERS : {\n\
  103.     *(.text)\n\
  104.      etext  =  . ; _etext = .;\n\
  105.      . = ALIGN(0x200);\n\
  106.   }\n\
  107.   .data  . : {\n\
  108.      *(.ctor)\n\
  109.      *(.dtor)\n\
  110.     *(.data)\n\
  111.      edata  =  . ; _edata = .;\n\
  112.      . = ALIGN(0x200);\n\
  113.   }\n\
  114.   .bss  SIZEOF(.data) + ADDR(.data) :\n\
  115.   {                     \n\
  116.     *(.bss)\n\
  117.     *(COMMON)\n\
  118.      end = . ; _end = .;\n\
  119.      . = ALIGN(0x200);\n\
  120.   }\n\
  121. }\n\n"
  122.   ; else if (!config.magic_demand_paged) return
  123. "OUTPUT_FORMAT(\"coff-go32\")\n\
  124. SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/go32/lib);\n\
  125. ENTRY(start)\n\
  126. SECTIONS\n\
  127. {\n\
  128.   .text  0x1000+SIZEOF_HEADERS : {\n\
  129.     *(.text)\n\
  130.      etext  =  . ; _etext = .;\n\
  131.      . = ALIGN(0x200);\n\
  132.   }\n\
  133.   .data  ALIGN(0x1000) : {\n\
  134.      *(.ctor)\n\
  135.      *(.dtor)\n\
  136.     *(.data)\n\
  137.      edata  =  . ; _edata = .;\n\
  138.      . = ALIGN(0x200);\n\
  139.   }\n\
  140.   .bss  SIZEOF(.data) + ADDR(.data) :\n\
  141.   {                     \n\
  142.     *(.bss)\n\
  143.     *(COMMON)\n\
  144.      end = . ; _end = .;\n\
  145.      . = ALIGN(0x200);\n\
  146.   }\n\
  147. }\n\n"
  148.   ; else return
  149. "OUTPUT_FORMAT(\"coff-go32\")\n\
  150. SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/local/go32/lib);\n\
  151. ENTRY(start)\n\
  152. SECTIONS\n\
  153. {\n\
  154.   .text  0x1000+SIZEOF_HEADERS : {\n\
  155.     *(.text)\n\
  156.      etext  =  . ; _etext = .;\n\
  157.      . = ALIGN(0x200);\n\
  158.   }\n\
  159.   .data  ALIGN(0x1000) : {\n\
  160.      *(.ctor)\n\
  161.      *(.dtor)\n\
  162.     *(.data)\n\
  163.      edata  =  . ; _edata = .;\n\
  164.      . = ALIGN(0x200);\n\
  165.   }\n\
  166.   .bss  SIZEOF(.data) + ADDR(.data) :\n\
  167.   {                     \n\
  168.     *(.bss)\n\
  169.     *(COMMON)\n\
  170.      end = . ; _end = .;\n\
  171.      . = ALIGN(0x200);\n\
  172.   }\n\
  173. }\n\n"
  174. ; }
  175.  
  176. struct ld_emulation_xfer_struct ld_go32_emulation = 
  177. {
  178.   gldgo32_before_parse,
  179.   syslib_default,
  180.   hll_default,
  181.   after_parse_default,
  182.   after_allocation_default,
  183.   set_output_arch_default,
  184.   ldemul_default_target,
  185.   before_allocation_default,
  186.   gldgo32_get_script,
  187.   "go32",
  188.   "coff-go32"
  189. };
  190.